<?php
/**
 * Created by PhpStorm.
 * User: MrHung
 * Date: 3/11/14
 * Time: 3:02 PM
 */

namespace Api\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Admin\Model\AdminAppTable;
use \Velacolib\Utility\Utility;

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
class AppversionController extends AbstractActionController {

    protected $appModel;

    public function onDispatch(\Zend\Mvc\MvcEvent $e)
    {

        $this->appModel = Utility::UserGateway('Admin\Model\AdminAppTable');
        return parent::onDispatch($e);
    }

    public function indexAction(){
       $app = $this->appModel->getLastVersion();
       echo json_encode($app);die;

    }
} 